import _http from '@/utils/request'
import type {
  loginFormData,
  loginResponseData,
  userResponseDate,
  logoutResponseData,
} from '@/api/user/type'
// 统一管理接口
enum API {
  //   LOGIN_URL = '/admin/acl/index/login',
  //   USERINFO_URL = '/admin/acl/index/info',
  LOGOUT_URL = '/admin/acl/index/logout',

  LOGIN_URL = '/user/login',
  USERINFO_URL = '/user/info',
}
//   _http({
//     method: 'post',
//     url: API.LOGIN_URL,
//     data,
//   })

//登录
export const reqLogin = (data: loginFormData) =>
  _http.post<loginFormData, loginResponseData>(API.LOGIN_URL, data)

export const reqUserInfo = () =>
  _http.get<any, userResponseDate>(API.USERINFO_URL)

export const reqLogout = () =>
  _http.post<any, logoutResponseData>(API.LOGOUT_URL)
